package com.yjd.comm.fs.model;

import com.yjd.comm.base.model.Model;

/**
 * 文件信息
 * 
 * @author ready
 * 
 */
public class FsFileModel extends Model {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 编号
	 */
	private Long idFsFile;
	/**
	 * 文件系统id
	 */
	private Long idFsConfig;
	/**
	 * 源文件名称
	 */
	private String originalFileName;
	/**
	 * 文件大小
	 */
	private Long fileSize;
	/**
	 * 相对于文件系统服务中根目录的地址，如跟目录的地址是/www/upload/，上传图像的相对地址是images/20140722/1.jpg
	 */
	private String filePath;

	/**
	 * 创建时间
	 */
	private Long createTime;

	/**
	 * web文件的web访问路径
	 */
	private String fileWebPath;

	/**
	 * fs配置信息
	 */
	private FsConfigModel fsConfigModel;

	public Long getIdFsFile() {
		return idFsFile;
	}

	public void setIdFsFile(Long idFsFile) {
		this.idFsFile = idFsFile;
	}

	public Long getIdFsConfig() {
		return idFsConfig;
	}

	public void setIdFsConfig(Long idFsConfig) {
		this.idFsConfig = idFsConfig;
	}

	public String getOriginalFileName() {
		return originalFileName;
	}

	public void setOriginalFileName(String originalFileName) {
		this.originalFileName = originalFileName;
	}

	public Long getFileSize() {
		return fileSize;
	}

	public void setFileSize(Long fileSize) {
		this.fileSize = fileSize;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public Long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}

	public String getFileWebPath() {
		if (this.getFsConfigModel() != null
				&& this.getFsConfigModel().getFsWebModel() != null) {
			this.fileWebPath = this.getFsConfigModel().getFsWebModel()
					.getRootPathUrl()
					+ this.getFilePath();
		}
		return fileWebPath;
	}

	public FsConfigModel getFsConfigModel() {
		return fsConfigModel;
	}

	public void setFsConfigModel(FsConfigModel fsConfigModel) {
		this.fsConfigModel = fsConfigModel;
	}

}
